﻿using Xejen.Database.Entities;
using Xejen.Database.Entities.Auditing;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xejen.Database.SqlSugar.Sqlite.Demos
{
    /// <summary>
    /// 表示Api请求记录表
    /// </summary>
    /// <creator>marc</creator>
    [SugarTable("ApiRequestRecords")]
    [Description("Api请求记录表")]
    public class ApiRequestRecordEntity : CreationEntity<long>, IEntity<long>
    {
        /// <inheritdoc/>
        [Key]
        [Column(Order = 100)]
        [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]//设为主键，且自增（IsIdentity = true）
        [Description("主键id")]
        public override long Id { get; set; }

        /// <summary>
        /// 事件唯一名称
        /// </summary>
        [SugarColumn(ColumnName = "Name")]
        public string Name { get; set; }

        /// <summary>
        /// 请求地址 
        /// </summary>
        [SugarColumn(ColumnName = "RequestAddress")]
        public string RequestAddress { get; set; }

        /// <summary>
        /// 发送的数据
        /// </summary>
        [SugarColumn(ColumnName = "SendData")]
        public string SendData { get; set; }

        /// <summary>
        /// 请求结果码
        /// </summary>
        [SugarColumn(ColumnName = "ReturnCode")]
        public string ReturnCode { get; set; }

        /// <summary>
        /// 错误信息
        /// </summary>
        [SugarColumn(ColumnName = "Msg")]
        public string Msg { get; set; }

        /// <summary>
        /// 远端发下来的原始数据
        /// </summary>
        [SugarColumn(ColumnName = "ReceiveData")]
        public string ReceiveData { get; set; }

        /// <inheritdoc cref="ApiRequestRecordEntity"/>
        public ApiRequestRecordEntity()
        {

        }
    }
}
